package com.atguigu.gulimall.ware.service;

import com.atguigu.gulimall.common.to.OrderTo;
import com.atguigu.gulimall.common.to.SkuHashStockVo;
import com.atguigu.gulimall.common.to.mq.StockLockedTo;
import com.atguigu.gulimall.ware.vo.LockStockResult;
import com.atguigu.gulimall.ware.vo.WareSkuLockVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author yp
 * @email sunlightcs@gmail.com
 * @date 2021-07-05 22:27:38
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    WareSkuEntity getBySkuId(Long skuId);

    List<SkuHashStockVo> getSkusHasStock(List<Long> skuIds);

    Boolean orderLockStock(WareSkuLockVo vo);

    void handleStockLOckRelease(StockLockedTo lockedTo) throws IOException;

    void OrderCloseNoQuick(OrderTo orderTo);
}

